<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    const str = '12 sfd 56 dddd 089 -== bcd'

    const arr = []
    let temp = ''

    for(var i=0;i<str.length;i++){
      if (str.charAt(i) >= '0' && str.charAt(i) <= '9') {
        temp += str.charAt(i)
      } else {
        if (temp) {
          arr.push(temp)
          temp = ''
        }
      }
    }

    if (temp) {
      arr.push(temp)
      temp = ''
    }

    alert(arr)
    
  </script>
</body>
</html>